package svc

import (
	"backend/apps/book/api/internal/config"
	"backend/apps/book/rpc/bookservice"
	"github.com/zeromicro/go-zero/zrpc"
)

type ServiceContext struct {
	Config  config.Config
	BookRpc bookservice.BookService
}

func NewServiceContext(c config.Config) *ServiceContext {
	rpcClient := zrpc.MustNewClient(c.BookRpc)
	return &ServiceContext{
		Config:  c,
		BookRpc: bookservice.NewBookService(rpcClient),
	}
}
